$ratio: 375 / 10;
$homeAnimationTime: .2s;
$homeAnimationType: linear;
$shelfAnimationTime: .2s;
$shelfAnimationType: linear;

// px转rem公式计算
@function px2rem($px) {
  @return $px / $ratio + rem;
}

@mixin scroll {
  overflow-x: hidden;
  overflow-y: scroll;
  -webkit-overflow-scrolling: touch;

  &::-webkit-scrollbar {
    display: none;
  }
}

@mixin center {
  display: flex;
  justify-content: center;
  align-items: center;
}

@mixin top {
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

@mixin bottom {
  display: flex;
  justify-content: center;
  align-items: flex-end;
}

@mixin leftBottom {
  display: flex;
  justify-content: flex-start;
  align-items: flex-end;
}


@mixin left {
  display: flex;
  justify-content: flex-start;
  align-items: center;
}

@mixin right {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

@mixin rightBottom {
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
}

@mixin columnCenter {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

@mixin columnTop {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
}

@mixin columnTopLeft {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
}

@mixin columnLeft {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}

@mixin absCenter {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  margin: auto;
}

// 省略显示
@mixin ellipsis {
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

@mixin ellipsis2($line) {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: $line;
  word-break: keep-all;
  white-space: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  overflow-wrap: break-word;
}

.icon {
  color: #666;
  font-size: px2rem(16);
}

.title {
  color: #666;
  font-size: px2rem(16);
  font-weight: bold;
}

// @mixin shelfImgHeight {
//   @media screen and (max-width:414px) {
//     height: px2rem(115)
//   }

//   @media screen and (min-width: 415px) and (max-width: 500px) {
//     height: px2rem(115)
//   }

//   @media screen and (min-width: 501px) and (max-width: 600px) {
//     height: px2rem(125)
//   }

//   @media screen and (min-width: 601px) and (max-width: 700px) {
//     height: px2rem(155)
//   }

//   @media screen and (min-width: 701px) and (max-width: 800px) {
//     height: px2rem(155)
//   }

//   @media screen and (min-width: 801px) {
//     height: px2rem(155)
//   }
// }
